const { sqlPromise } = require("../db/sqlPromise");

//根据id获取用户优惠卷信息
exports.getCoupon = async (req, res) => {
  console.log(req.params);
  let user_id = req.params.id;
  let sql = "select * from coupon where user_id = ?";
  let result = await sqlPromise(sql, [user_id]);
  res.send({
    meta: {
      msg: "获取成功",
      status: 200,
    },
    data: {
      coupons: result,
    },
  });
};
